var myChart = echarts.init(document.getElementById("idx1"));
var option = {
    title: {
        text: '周子昂',
        bottom: '1',
        left: '1',
    },
    series:{
       type:'graph',
       data:[{
           name:'小明',
           x:10 ,
           y: 50,
       },{
           name: '小红',
           x: 50,
           y: 100,
       },{
            name:'老王',
            x: 90,
            y: 50,
       }],
       symbolSize: 30,
       links:[{
           source: '小明',
           target: '老王',
       },{
        source: '小明',
        target: '小红',
       },{
        source: '老王',
        target: '小红',
       }]
    },
    
};
myChart.setOption(option)
 
 
var myChart2 = echarts.init(document.getElementById("idx2"));
var option2 = {
    title: {
        text: '周子昂',
        bottom: '1',
        left: '1',
    },
    series:{
       type:'graph',
       data:[{
           name:'小明',
           x:10 ,
           y: 50,
       },{
           name: '小红',
           x: 50,
           y: 100,
       },{
            name:'老王',
            x: 90,
            y: 50,
       }],
       symbolSize: 30,
       symbol: 'roundRect',
       links:[{
           source: '小明',
           target: '老王',
           lineStyle: {
               color: 'red',
               width: 10,
           },
           label:{
               formatter: '邻居',
               show: true,
           }
       },{
        source: '小明',
        target: '小红',
        lineStyle: {
            color: 'red',
            width: 10,
        },
        label:{
            formatter: '同学',
            show: true,
        }
       },{
        source: '老王',
        target: '小红',
        lineStyle: {
            color: 'red',
            width: 10,
        },
        label:{
            formatter: '邻居',
            show: true,
        }
       }],

       itemStyle:{
           color: 'red',
           borderColor: 'black',
       },
       label: {
           show: true,
           position: 'top',
       },
    },
    
};
myChart2.setOption(option2)
 
 
var myChart3 = echarts.init(document.getElementById("idx3"));
var option3 = {
    title: {
        text: '周子昂',
        bottom: '1',
        left: '1',
    },
    series:{
       type:'graph',
       data:[{
           name:'小明',
           x:10 ,
           y: 50,
       },{
           name: '小红',
           x: 50,
           y: 100,
       },{
            name:'老王',
            x: 90,
            y: 50,
       }],
       symbolSize: 30,
       //symbol: 'roundRect',
       symbol: 'image://cdn3-banquan.ituchong.com/weili/l/57413576633229293.jpeg',
       links:[{
           source: '小明',
           target: '老王',
           lineStyle: {
               color: 'red',
               width: 10,
           },
           label:{
               formatter: '邻居',
               show: true,
           }
       },{
        source: '小明',
        target: '小红',
        lineStyle: {
            color: 'red',
            width: 10,
        },
        label:{
            formatter: '同学',
            show: true,
        }
       },{
        source: '老王',
        target: '小红',
        lineStyle: {
            color: 'red',
            width: 10,
        },
        label:{
            formatter: '邻居',
            show: true,
        }
       }],

       itemStyle:{
           color: 'red',
           borderColor: 'black',
       },
       label: {
           show: true,
           position: 'top',
       },
    },
    
};
myChart3.setOption(option3)
 
var myChart4 = echarts.init(document.getElementById("idx4"));
var option4 = {
    title: {
        text: '周子昂',
        bottom: '1',
        left: '1',
    },
    series:{
       type:'graph',
       layout: 'force',
       force: {
           repulsion: 10000,
       },
       roam: true,
       draggable: true,
       label: {
           show: true,
           position: 'bottom',
       },
       data:[{
           name:'小明',
           symbol: 'image://cdn3-banquan.ituchong.com/weili/l/918437876807368753.jpeg',
       },{
           name: '小红',
           symbol: 'image://https://t7.baidu.com/it/u=3454552242,2602620696&fm=193&f=GIF',
       },{
            name:'老王',
            symbol: 'image://https://t7.baidu.com/it/u=2366989191,2169799746&fm=193&f=GIF',
       }],
       symbolSize: 30,
       links: [{
           source: 0,
           target: 1,
           label: {
               formatter: '朋友',
               show: true,
           },
       },{
        source: 2,
        target: 1,
        label: {
            formatter: '邻居',
            show: true,
        },
    },{
        source: 0,
        target: 2,
        label: {
            formatter: '邻居',
            show: true,
        },
    }],
       
      
    },
    
};
myChart4.setOption(option4)
 
 
 
var myChart5 = echarts.init(document.getElementById("idx5"));
var option5 = {
    title: {
        text: '周子昂',
        bottom: '1',
        left: '1',
    },
    series:{
       type:'graph',
       layout: 'force',
       force: {
           repulsion: 10000,
       },
       roam: true,
       draggable: true,
       focusNodeAdjacency: true,
       label: {
           show: true,
       },
       categories: [{
           name: '学生',
           itemStyle: {
               color: 'red',
           },
       },{
        name: '工人',
        itemStyle: {
            color: 'blue',
        },
    },{
        name: '老人',
        itemStyle: {
            color:'green',
        },
    }],
       data:[{
           name:'小明',
           category: 0,
       },{
           name: '小红',
           category: 1,

       },{
            name:'老王',
            category: 2,

       },{
           name: '小赵',
           category: 0,
       },{
           name: '小钱',
           category: 1,
       }],
       symbolSize: 30,
       links: [{
           source: 0,
           target: 1,
 
       },{
        source: 2,
        target: 1,

    },{
        source: 0,
        target: 2,

    },{
        source: 2,
        target: 3,

    },{
        source: 1,
        target: 4,

    }],
       
      
    },
    
};
myChart5.setOption(option5)
 
 
var myChart6 = echarts.init(document.getElementById("idx6"));
var option6 = {
    title: {
        text: '周子昂',
        bottom: '1',
        left: '1',
    },
    series:{
       type:'graph',
       layout: 'circular',
       data:[{
           name:'小明',

       },{
           name: '小红',
         
       },{
            name:'老王',
           
       },{
        name:'小孙',
       
       },{
        name:'小王',
       
       },{
        name:'小张',
       
       },{
        name:'小李',
       
       },{
        name:'小周',
       
       }],
       symbolSize: 30,
    },
    
};
myChart6.setOption(option6)